import request from '@/utils/request'
import type { ApiResponse } from '../index'

export interface CommentParams {
  content: string
  rating: number
}

export const commentApi = {
  // 添加服务评论
  addServiceComment(serviceId: number, data: CommentParams) {
    return request.post<ApiResponse>(`/user/services/${serviceId}/comments`, data)
  },


  // 添加目的地评论
  addDestinationComment(destinationId: number, data: CommentParams) {
    return request.post<ApiResponse>(`/user/destinations/${destinationId}/comments`, data)
  },

  // 添加文章评论
  addPostComment(postId: number, data: CommentParams) {
    return request.post<ApiResponse>(`/user/posts/${postId}/comments`, data)
  }
}